<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数码时钟</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        html,
        body {
            height: 100%;
            position: relative;
        }

        div {
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
        }

        img {
            display: inline-block;
            vertical-align: middle;
        }

        span {
            vertical-align: middle;
        }
    </style>
</head>

<body>
    <div>
        <!-- <img src="../images/0.png" alt="">
        <img src="../images/0.png" alt="">
        <span>-</span>
        <img src="../images/0.png" alt="">
        <img src="../images/0.png" alt="">
        <span>-</span>
        <img src="../images/0.png" alt="">
        <img src="../images/0.png" alt=""> -->
    </div>
</body>
<script src="../js/public.js"></script>
<script>
    let div = document.querySelector('div');


    setInterval(function () {
        let date = new Date();
        let hour = String(dates(date).hour);
        let minute = String(dates(date).minute);
        let second = String(dates(date).second);

        div.innerHTML = `
                            <img src="../images/${hour[0]}.png" alt="">
                            <img src="../images/${hour[1]}.png" alt="">
                            <span>-</span>
                            <img src="../images/${minute[0]}.png" alt="">
                            <img src="../images/${minute[1]}.png" alt="">
                            <span>-</span>
                            <img src="../images/${second[0]}.png" alt="">
                            <img src="../images/${second[1]}.png" alt="">
                        `
    }, 1000)





</script>

</html>